package lab01;

import java.util.Scanner;

public class Test08 {
    public static void main(String[] args) {
        System.out.println("猜数游戏.");
        System.out.println("请输入一个在100之内的数");
        Scanner s = new Scanner(System.in);
        int number = (int) (Math.random() * 100) + 1;

        while (true) {
            int num = s.nextInt();
            if (num > number) {
                System.out.println("输入的数大了.");
            } else if (num < number) {
                System.out.println("输入的数小了.");
            } else if (num == number) {
                System.out.println("输入的数中了.");
                break;
            }
        }
    }
}
